{\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fswiss\fcharset0 Arial;}{\f1\froman\fcharset0 Times New Roman;}}
{\colortbl ;\red0\green0\blue255;}
{\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\lang3082\b\f0\fs20 Starting with SVN:\par
\par
\par
\par
Important notes:\b0\par
  Any path or URL wich includes spaces must be surounded by double quotes (") in windows. In linux by single quotes (')\par
  The same for strings, like those in the switch -m in svn\par
  Use forward slashes in the URL, even in windows.\par
  If posible use all lowercase filenames for any file or directory in the project; there will be less problems of windows-unix compatibility (unix filenames are case sensitive. Also, note that in windows the case you see in Explorer may not match the real one ).\par
  If your OS is unix avoid to name two filesystem objects with the same name with diferent capitalization  ( window filenames are case insensitive)\par
Avoid the minus sign as first character in a filename ( ex problem: >svn ren "_01_test" "-01_test"  will produce a svn: invalid option character: 0)\par
  Operations that changes project file names dont mixes well with editions; to being safe follows this rules:\par
\tab before a svn del or svn copy or svn move or svn ren do a svn update (if operating over the URL) or a commit ( if operated over the working directory)\par
\tab after a svn copy, svn move, svn ren , and before changing the content of files, do a svn update (if changes where over the repo) or a comit (if opers where done over the working copy) \par
If posible avoid spaces in filenames, as to not need to surround filenames with quotes\par
\par
Nota sobre filespec:\par
En windows al menos un filespec que empieza con minus '-' es interpretado como opcion y produce el mensaje de error\par
>svn ren "_01_test" "-01_test"\par
svn: invalid option character: 0\par
Tipee 'svn help' para ver el modo de uso.\par
\par
Probamos a meter un blanco dentro de las comillas adelante del menos y lo tomo. Habria que ver si es compatible con unix.\par
--> pero en realidad no funciono: el blanco aparecio en el nombre del dir -> probamos desde tortoise ( navigate repos, click derecho sobre el dir, rename: parece que lo tomo)\par
Cuestion abierta : como hacerlo desde la linea de comandos. \'bfquizas subiendo un dir para que el path problematico quede como subdir ?\par
\par
\b Default properties for files and dirs:\b0\par
A good use of svn properties is great for sharing code beetween two OS,like Linux - Windows.\par
\par
Probably you want to set the 'svn:eol-style' property to 'native' for each code file of your projects ( this eliminates a lot of troubles around the diferent line endings used in each OS, notably:\par
  a. a text file is wrongly displayed in one of the OSes, or an app doenst handle foreign line endings\par
  b. a change in one character of a source file can be reported as modifiing all the lines of the file, because saving in one OS can use the OS convention,  thus changing all the line endings.\par
Note that other text files can benefit of  this property, like config files or textual descriptions of objects ( .lvl -> level file , etc) \par
\par
Another useful property is 'svn:executable', wich tells to unix OSes wich file are executables.\par
\par
While properties can be set manually for each file object, it is convenient to asociate default properties to certain file extensions ( like *.c <- svn:eol-style=native ). This can be done using the 'subversion configuration area', wich in a simple form boils down to edit configs files on a per-user basis.\par
\par
1. in windows the  location of per-user configs files is\par
\tab %APPDATA%\\Subversion\par
    ( type\par
\tab set APPDATA\par
      in a console to see to wich directory maps APPDATA; a common example is\par
 \par
\tab C:\\Documents and settings\\<user>\\Application Data\par
      )\par
2. in unix   at .subversion in the home directory\par
\par
3. The file that interest us is\par
\tab config\par
   ( subversion client must have been run at least one time for config existence )\par
   In windows edit with Notepad; double click doenst work  with files without extensions.  \par
\par
4. Look for the section\par
\tab  [miscellany]\par
    and uncomment the section\par
\tab # enable-auto-props = yes\par
\par
5. Then edit at will the next section,\par
\tab [auto-props]\par
    by uncomenting lines or adding the apropiated ones. By example for python source files you want\par
\tab *.py = svn:eol-style=native\par
\tab\par
6. Note that the autoprops aplies to files added _after_ the config is edited.\par
\par
\b Making svn ignore certain files in your working directory: \par
\b0 If there will be uninteresting files in your working directory ( like intermediate object files *.o ,  *.obj, *.pyc ) that you dont want to be commited to the repository, nor listed in a svn status command, then you want to enable global ignores.\par
To do that, edit the per-user config file ( see the prev section   \b Default properties for files and dirs  \b0 for the location) doing:\par
\par
1. go to the section\par
\tab [miscellany]\par
\par
2. add a line of the form\par
\tab global-ignores = *.xxx ; *.yyy; ...;*.zzz\par
   where xxx, yyy,  zzz are the extensions of the files to ignore. \par
   Examples:\par
\pard\sb100\sa100\tab global-ignores = *.obj ; *.pyc ; *.\lang11274\f1\fs24 ~c\par
As well as svn status, the svn add and svn import commands also ignore files that match the list when they are scanning a directory. You can override this behaviour for a single instance of any of these commands by explicitly specifying the file name, or by using the --no-ignore command-line flag.\par
For information on more fine-grained control of ignored items, see {\field{\*\fldinst{HYPERLINK "ch03s04.html"}}{\fldrslt{\cf1\ul the section called \ldblquote Ignoring Unversioned Items\rdblquote }}}\cf0\ulnone\f1\fs24 .\par
Nota: experimentar si globs mas generales son aceptados, como ser *.~*\par
\pard\lang3082\f0\fs20\par
\par
\b Repository creation:\b0\par
   1. Create a local directory wich will hold all the repositories, by example \par
\tab mkdir d:\\svnrepo \par
\par
   2. For each project create a repository dir ( at any time you can add a new project ). By example\par
\tab svnadmin create d:\\svnrepo\\magicor\par
\tab svnadmin create d:\\svnrepo\\gamebits\par
      The first line creates a repository for project magicor, the second for project gamebits.\par
      The URLs for the magicor project would be:\par
\tab file:///d:/svnrepo/magicor\par
      or\par
\tab svn://host/magicor\par
      The first is valid only on the local machine, the second is valid over the LAN , and asumes host is the IP or a valid name for the machine that stores the repository and that svnserve was started in the machine that stores the repository with the line\par
\tab svnserve -d -r d:\\svnrepo\par
     Note that using a common dir (ie d:\\svnrepo) to hold all the repositories ( ie magicor and gamebits ) you have the advantages:\par
\tab a. only one instance of svnserve is needed to serve all the repositories\par
\tab b. you share only content under the common dir.  ( _never_ start as 'svnserve -d d:\\' ;you will be sharing all the drive d: ) \par
\par
\b Populating a repository:\par
\b0    After creation it is convenient to impose the desired directory layout to each project. The most easy way to do this is building the directory tree under a temporal directory, by example d:\\tmp\\magicor, including any initial code  you have, and then importing into the repository. By example, using explorer you construct the tree\par
\tab d:\\tmp\\magi\par
\tab\tab trunk\par
\tab\tab     data\par
\tab\tab     code\par
\tab\tab     tools\par
\tab\tab art\par
and then import into the magicor project:\par
\tab d:\par
\tab cd \\tmp\par
\tab svn import magi file:///d:/svnrepo/magicor -m "initial repository layout"\par
\par
Note that forward slashes (/) separates the parts in the URL \par
You can test if all is ok by doing a checkout of the project.\par
The temporary directory have no further use, you can erase it now.\par
note: when a textual file (like *.py) has mixed line endings you may need to convert to a uniform line ending; look for utilities like unx2dos or dos2unx.\par
\par
\b Getting a working copy from a repository (Checking Out a project):\par
\b0    1. Decide in wich directory you want the working copy to reside. By example, if you store all your python languaje projects under d:\\sources\\python , you may want to have your working copy of magicor under d:\\sources\\python\\magicor  , or maybe d:\\sources\\python\\my_magicor. Go to the dir where the working copy will reside, by example\par
\tab d:\par
\tab cd d:\\sources\\python\par
\par
   2. Do the checkout:\par
\tab svn co file:///d:/svnrepo/magicor\par
       (this works only if the repository is in the same machine)\par
       or\par
\tab svn co svn://host/magicor\par
       (this works over the LAN if the machine with the repository has started svnserve with the line\par
\tab svnserve -d -r d:\\svnrepo\par
            and host is the IP or name for the machine that stores the repository\par
       )\par
      or\par
\tab svn co http://magicalrepo.net/magicor\par
     ( to cheking out from an internet repository)\par
\par
\b Query svn about the status of all files:\par
\b0 cd to the directory of interest and then issue the command\par
svn status -v\par
\par
\b Repository access through the LAN using svnserve:\par
\b0 If the LAN has a gateway to the internet, block incoming trafic directed to the machine:port where svnserve will run. By default svnserve will use port 3690.\par
To start the server, in the machine where the repository resides type in a console:\par
\tab svnserve -d -r d:\\svnrepo\par
( asuming all your repositories are under d:\\svnrepo ). Minimize the console and thats all.\par
If the Windows firewall ask about allowing svnserve to comunicate, tell yes.\par
When you want to terminate svnserve, press <ctrol> C.\par
If you prefer, the server can be started and managed as a service, look at the subversion documentation for this.\par
To set access rights read the svn manual.\par
\par
\b Dump a repository ( to relocate the repos ):\par
\b0\tab svnadmin dump d:\\repo_ui --deltas >d:\\repo_ui_dump.tmp\par
para recargarlo en otra locacion:\par
\tab svnadmin create d:\\svnrepo\\ui\par
\tab svnadmin load d:\\svnrepo\\ui <d:\\repo_ui_dump.tmp\par
Para comprobar se puede hacer un checkout a un temporario:\par
\tab d:\par
\tab cd \\tmp\par
\tab mkdir tmp\par
\tab svn co file:///d:/svnrepo/ui\par
\par
\par
\b Mover un repositorio de una maquina a otra preservando la historia:\b0\par
Se hizo un dump en master, copiamos el archivo dump a traves de la red a la maquina A7, donde\par
  1. dentro del dir que usamos para contener todos los repositorios de la maquina creamos con svnadmin un nuevo repositorio y luego cargamos el archivo dump :\par
\tab C:\\Documents and Settings\\jugar>svnadmin create f:\\svnrepos\\magicor_gamebits\par
\par
\tab C:\\Documents and Settings\\jugar>svnadmin load f:\\svnrepos\\magicor_gamebits <f:\\magi_gam3_dump.txt >load.log\par
\par
para verificar probamos a hacer un checkout:\par
\tab f:\par
\tab cd \\newcode\par
\tab svn co file:///f:/svnrepos/magicor_gamebits\par
y efectivamente aparece un subdir magicor_gamebits en newcode con los contenidos de la ultima revision en master ( r113)\par
\par
Nota: adicionalmente si tambien se movio una working copy, se puede correr en la working copy\par
\pard\sb100\sa100\lang11274\f1\fs24 svn switch --relocate file:///tmp/repos file:///tmp/newlocation \par
\pard\lang3082\f0\fs20 por ejemplo si cambiamos el repositorio de d:\\ a f:\\\par
\par
svn switch --relocate file:///d:/svnrepos/dflocal file:///f:/svnrepos/dflocal\par
\par
Esto es muy util si la working copy contenia files que no estaban bajo revision control pero que no deseamos perder.  \par
\par
\b Make a branch:\par
\b0 We have a repository in f:\\svnrepos\\gamebits \par
F:\\newcode>svn copy file:///f:/svnrepos/gamebits/trunk file:///f:/svnrepos/gamebits/b_magi -m "branch with the ultimate purpose of comparison with the magicor version"\par
\par
Commit de la revisi\'f3n 2.\par
\par
F:\\newcode>svn co file:///f:/svnrepos/gamebits/b_magi\par
A    b_magi\\gamebits\par
...\par
A    b_magi\\examples\\text_align\\test_text.py\par
Revisi\'f3n obtenida: 2\par
\par
F:\\newcode>\par
\par
After the co we have a new directory b_magi under newcode\par
\par
\b Mover todos los cambios de un branch a trunk:\par
\b0 Tenemos la situacion:\par
\par
F:\\newcode\\gamebits\\trunk>svn info\par
Ruta: .\par
URL: file:///f:/svnrepos/gamebits/trunk\par
Ra\'edz del repositorio: file:///f:/svnrepos/gamebits\par
UUID del repositorio: 50669e8a-5928-234c-a772-7396675bdfbc\par
Revisi\'f3n: 1\par
Tipo de nodo: directorio\par
Agendado: normal\par
Autor del \'faltimo cambio: jugar\par
Revisi\'f3n del \'faltimo cambio: 1\par
Fecha de \'faltimo cambio: 2008-02-18 13:38:04 -0300 (Lun, 18 Feb 2008)\par
\par
\par
F:\\newcode\\gamebits\\trunk>cd F:\\newcode\\b_magi\par
\par
F:\\newcode\\b_magi>svn info\par
Ruta: .\par
URL: file:///f:/svnrepos/gamebits/b_magi\par
Ra\'edz del repositorio: file:///f:/svnrepos/gamebits\par
UUID del repositorio: 50669e8a-5928-234c-a772-7396675bdfbc\par
Revisi\'f3n: 2\par
Tipo de nodo: directorio\par
Agendado: normal\par
Autor del \'faltimo cambio: jugar\par
Revisi\'f3n del \'faltimo cambio: 2\par
Fecha de \'faltimo cambio: 2008-02-18 15:01:34 -0300 (Lun, 18 Feb 2008)\par
\par
Both working copies are updated to the last version, ie svn status gives empty list as result.\par
\par
Hacemos cd \\\par
F:\\>svn merge file:///f:/svnrepos/gamebits/trunk  file:///f:/svnrepos/gamebits/b_magi  f:/newcode/gamebits/trunk\par
U    F:\\newcode\\gamebits\\trunk\\gamebits\\events.py\par
....\par
U    F:\\newcode\\gamebits\\trunk\\examples\\text_align\\test_text.py\par
\par
La working copy de trunk (f:/newcode/gamebits/trunk) recibio el cambio.\par
Las diferencias entre la 2da URL y la primera URL se agregaron a la working copy de trunk.\par
Despues de la oper, un svn en la working copy de trunk status muestra los mismos files que aparecen en la lista del merge.\par
\par
Se hace un commit en la working copy de trunk para aceptar los cambios:\par
svn commit -m "trunk updated to the gamebits library version used in magicor_gamebits r137" \par
\par
NOTA: en lo anterior no pusimos atencion a posibles files unversioned. Habria que revisar eso.\par
\par
Habria que hacer un .bat para merge dry run ? y explicar conflictos ?\par
\par
\b Volviendo un proyecto a una revision anterior ( bactracking):\b0\par
\par
reverting factory to rev23:\par
primero hacemos un commit de factory, porque el dir esta en rev 23 a pesar de que  los files adentro estaban a rev 24.\par
Quedamos con factory a rev25\par
\par
D:\\newcode\\docutils\\trunk\\sandbox\\gschwant\\docfactory>svn merge -r 25:23 file://\par
/d:/svnrepos/docutils/trunk/sandbox/gschwant/docfactory/factory factory\par
D    factory\\business.py\par
U    factory\\dialogs.py\par
U    factory\\main.py\par
\par
D:\\newcode\\docutils\\trunk\\sandbox\\gschwant\\docfactory>svn commit -m "rollback a\par
rev 23"\par
A\'f1adiendo      docfactory\\business.py\par
Eliminando     docfactory\\factory\\business.py\par
Enviando       docfactory\\factory\\dialogs.py\par
Enviando       docfactory\\factory\\main.py\par
Transmitiendo contenido de archivos ..\par
Commit de la revisi\'f3n 26.\par
\par
(el archivo business.py que habia sido agregado en 24 se borro en factory pero se  copio a ../factory , suponemos que por seguridad)\par
\par
\b Externals - asociating certain subdirs in a working copy with other repositories:\par
\b0\par
There are many quirks in this topic. You must have a working knowledge about commom svn opers to understand this topic.\par
Skip this if you are new to subversion, it will only confuse you.\par
______\par
\par
Tendriamos que poner ejemplo claro de:\par
\par
branch from trunk\par
\par
update the branch with trunk diferences\par
\par
merge the branch into trunk.\par
\par
________\par
\par
Como entrenamiento se le podria guiar por pasos en una serie de ejercicios.\par
\par
1. Poner las propiedades de svn client\par
\par
2. crear un dir base para todos los repositorios (mk dir)\par
\par
3. crear un repositorio (svn admin)\par
\par
4. carga inicial del repositorio\par
\par
5. [ Query desde admin?]\par
\par
6. checkout - working copy\par
\par
7. revert - diff - status\par
\par
8. commit - resolve - importance of proper logs: identify the begin and end of certain changes (fixing bug wwwZZZ), moving code ( files, directories or sections of code )\par
\par
9. rollback\par
\par
\par
}
 